import { ApiProperty } from '@nestjs/swagger';
import { Contains, Length } from 'class-validator';

export class LoginDto {
  @ApiProperty({
    title: '用户名',
    required: true,
  })
  @Length(5, 10, { message: '用户名长度必须在$constraint1到$constraint2个字符之间' })
  username: string;

  @ApiProperty({
    title: '密码',
    required: true,
  })
  @Length(6, 20, { message: '密码长度必须在$constraint1到$constraint2个字符之间' })
  password: string;
}

export class RegisterDto {
  @ApiProperty({
    title: '用户名',
    required: true,
  })
  @Length(5, 10, { message: '用户名长度必须在$constraint1到$constraint2个字符之间' })
  username: string;

  @ApiProperty({
    title: '密码',
    required: true,
  })
  @Length(6, 20, { message: '密码长度必须在$constraint1到$constraint2个字符之间' })
  password: string;
}

export class ClientInfoDto {
  ipaddr: string;
  userAgent: string;
  browser: string;
  os: string;
  location: string;
}
